<!doctype html><html lang="zh-Hans-CN"><head>	<meta charset="UTF-8">	<title>日期对象的应用</title></head><body >	<h4>获得当前日期对象的年、月、日、时、分、秒、星期 .getFullYear|Month|Date|Day|Hours|Minutes|Seconds()</h4>	<hr>	<script>		let week =["日","一","二","三","四","五","六"];		let now = new Date();		let y = now.getFullYear();		let m = now.getMonth()+1;		let d = now.getDate();		let h = now.getHours();		let mi = now.getMinutes();		let s = now.getSeconds();		if(m<10){m="0"+m;}		if(d<10){d="0"+d;}		if(h<10){h="0"+h;}		if(mi<10){mi="0"+mi;}		s=(s<10)?("0"+s):s;  //if(s<10){s="0"+s;}		let str = y+"年"+m+"月"+d+"日 "+h+":"+mi+":"+s+" 星期"+week[now.getDay()];		document.write(str);	</script>	<hr>	<p> <script>document.write(document.lastModified);</script> <a href="index.html">返回本章目录</a></p></body></html>